package com.example.lte.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.sql.Timestamp;

@Entity
@Table(name = "lte_button",uniqueConstraints=@UniqueConstraint(columnNames={"buttonName"}))
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ButtonEntity {
    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    private Long buttonId;


    @Column(length = 50)
    private String buttonName;

    @Column(length = 64)
    private String note;

    @CreationTimestamp
    @Column(name = "add_time", columnDefinition = "DATETIME COMMENT '添加时间'")
    private Timestamp addTime;

    @UpdateTimestamp
    @Column(name = "update_time", columnDefinition = "DATETIME COMMENT '最后更新时间'")
    private Timestamp updateTime;


    @Version
    @Column(name = "version", columnDefinition = "bigint COMMENT '版本号'")
    private Long version;
}
